package org.jetnuke.common;

import java.util.HashMap;

public class BlockInfo implements IBlockInfo {

	String name;

	String description;

	String blockClass;

	boolean activated;

	boolean valid = true;

	HashMap paramMap = new HashMap();

	private String templateName;

	private int bid;

	public int getBid() {
		return bid;
	}

	public void setBid(int bid) {
		this.bid = bid;
	}

	public String getPath() {
		return path;
	}

	private String path;

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getName()
	 */
	public String getName() {

		return name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getDescription()
	 */
	public String getDescription() {

		return description;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getBlockClass()
	 */
	public String getBlockClass() {

		return blockClass;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getParameterNames()
	 */
	public String[] getParameterNames() {

		return (String[]) paramMap.keySet().toArray(new String[0]);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getParameterValue(java.lang.String)
	 */
	public String getParameterValue(String name_) {

		return (String) paramMap.get(name_);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#isActivated()
	 */
	public boolean isActivated() {

		return activated;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#isValid()
	 */
	public boolean isValid() {

		return valid;
	}

	/**
	 * @param nodeValue
	 */
	public void setDescription(String des) {
		this.description = des;

	}

	public void setActivated(boolean activated) {
		this.activated = activated;
	}

	public void setBlockClass(String blockClass) {
		this.blockClass = blockClass;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValid(boolean valid) {
		this.valid = valid;
	}

	public void putParam(String name_, String value) {
		paramMap.put(name_, value);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#getTemplate()
	 */
	public String getTemplateName() {
		return templateName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#setTemplate()
	 */
	public void setTemplateName(String template) {
		this.templateName = template;
	}

	/**
	 * @param xmlPath
	 */
	public void setPath(String xmlPath) {
		this.path = xmlPath;

	}

	/**
	 * @param position
	 */
	public void setPosition(String position) {
		this.position = position;
	}

	private String position;

	private boolean adminOnly;

	private boolean anonymousOnly;

	private boolean userOnly;
	private String title;

	private String rssUrl;

	private String content;

	public String getContent() {
		return content;
	}
	public String getTitle() {
		return title;
	}
	public String getPosition() {
		return position;
	}

	/**
	 * @param b
	 */
	public void setAdminOnly(boolean b) {
		adminOnly = b;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#isAdminOnly()
	 */
	public boolean isAdminOnly() {

		return adminOnly;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#isAnonymousOnly()
	 */
	public boolean isAnonymousOnly() {

		return anonymousOnly;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IBlockInfo#isUserOnly()
	 */
	public boolean isUserOnly() {
		return userOnly;
	}

	/**
	 * @param b
	 */
	public void setAnonymousOnly(boolean b) {
		anonymousOnly = b;
	}

	public void setUserOnly(boolean b) {
		userOnly = b;
	}

	/**
	 * @param title
	 */
	public void setTitle(String title) {
		this.title=title;
		
	}

	/**
	 * @param rss_url
	 */
	public void setRssUrl(String rss_url) {
		this.rssUrl=rss_url;
		
	}
	public String getRssUrl() {
		return rssUrl;
	}

	/**
	 * @param content
	 */
	public void setContent(String content) {
		this.content=content;
		
	}
}
